The packet switched transport network is widely applied in the telecom transport network. A packet switched network is based on packet exchanging. The packet transport device on the network is asynchronous, but network applications impose requirements on clock synchronization and precise time synchronization. For example, the 3rd Generation (3 G) transport network needs to transmit information of precise time and clocks. The Institute of Electrical and Electronics Engineers (IEEE) 1588 Standard provides a basis for clock synchronization and time synchronization of the packet switched network.
In the existing IEEE 1588 Standard, the Best Master Clock (BMC) selection method includes using the BMC clock source comparison algorithm to select the source, using the BMC port state determining algorithm to select the source, and using the BMC port state machine to select the source.
The BMC source selection method involves the following aspects described below.
Each port of the device receives different announce packets, and the BMC clock source comparison algorithm is run according to the clock source information (including the clock source quality level, serial number of the clock source, and topology structure of network transmission) carried in the announce packet to select the best clock source for each port (Erbest).
The device runs the BMC clock source comparison algorithm again according to the Erbest of each port and selects the best clock source for the whole device (Ebest).
The device runs the BMC port state determining algorithm according to the local clock (D0), the best clock source (Erbest) for each port, and the best clock source (Ebest) for the whole device, and determines the type of each port: BMC_slave (clock source port), BMC_master (port for distributing clocks), or BMC_passive (port neither for distributing nor for tracking clocks).
Each port runs the BMC port state machine and determines the state of the port according to the current state of the port and the BMC event. The states of the port include initializing, listening, faulty, disabled, pre_master, master, uncalibrated, slave, and passive states.
After the port in the master state receives a “slave” message, the state changes to “uncalibrated”, and the time count begins. After the time count reaches the set time; the state changes to “slave”. After the port in the “slave” state receives a “master” message, the state changes to “pre_master”, and the time count begins. After the time count reaches the set time, the state changes to “master.”
After the foregoing BMC source selection method is applied, the IEEE 1588 clock network as shown in FIG. 1 is formed. It can be seen that, the whole clock network is of a tree structure. Each Boundary Clock (BC) ultimately succeeds in tracking the grandmaster clock.
In actual applications of the transport network, typically the maximum number of boards connectible to a network element is greater than ten, and multiple ports exist on each board. Each port has multiple (e.g., five) optional clock sources. If all the announce packets arriving at each port participate in the source selection according to the BMC algorithm, the source selection is performed based on hundreds of clock sources. Moreover, the actual networking is miscellaneous, and the corresponding clock network is rather complicated. Upon initial operation of the network and after the network changes, the clock network oscillates sharply and the convergence of clock source selection tends to be slow.
For example, in the clock network architecture of the transport network architecture shown in FIG. 2, the convergence-layer device BC-1 has four ports: port 1, port 2, port 3, and port 4. In the source selection based on the existing BMC algorithm, the source selection process may experience the problems described below.
First, port 4 sends an access-layer clock source whose clock stratum is higher than the clock stratum of the local clock, and the device BC-1 tracks the clock source sent by port 4 according to the BMC algorithm.
Afterward, port 2 sends a clock source of a grandmaster clock of a Primary Reference Clock (PRC), and the device BC-1 switches over to the track source of port 2.
Afterward, port 3 sends the access-layer track source and introduces the grandmaster clock source of the PRC. However, the number of BC devices in the path of the track source is less than the number of BC devices in the path of the clock source introduced by port 2. According to the BMC algorithm, the device BC-1 switches over to the track source sent by port 3.
Finally, port 1 sends a track source and also introduces the grandmaster clock source of the PRC. However, the number of BC devices in the path of the track source is less than the number of BC devices in the path from the grandmaster clock source introduced by port 3 to the device BC-1. According to the BMC algorithm, the device BC-1 switches over to the track source sent by port 1.
Therefore, the track source of the device BC-1 is switched over three times: switchover from the track source of port 4 to the track source of port 2, switchover from the track source of port 2 to the track source of port 3, and switchover from the track source of port 3 to the track source of port 1. The clock oscillates sharply, and the convergence of the clock source selection is slow.
Moreover, transport networks generally include access-layer networks and convergence-layer networks. In the planning of a network, a master clock source and a slave clock source are generally configured for the convergence-layer network. Certain ports in the device are configured as follows: the port for receiving only the clock source packet from the access layer is configured as a port for distributing clocks out instead of a port for participating in the source selection, and the port for receiving the clock source packet from the convergence layer is configured as a port for participating in the source selection.
However, according to the BMC source selection method in the prior art, the packets received by all ports of the device participate in the source selection which is not consistent with the network planning. For example, in the clock networking architecture of another transport network shown in FIG. 3 according to the planning, a master clock source and a slave clock source are configured for the convergence-layer network. Therefore, only two ports need to be configured for the device BC-1 in the convergence-layer network to participate in the source selection. However, if the BMC source selection method is applied, the packets received by all ports of the device BC-1 participate in the source selection, for example, two types of packets received by port 1 and port 2 from the convergence layer, and eight types of packets received by port 3 and port 4 from the access layer. That is, the device BC-1 needs to select a source according to ten types of packets, which is not consistent with the network planning and tends to cause slow convergence of the clock source selection and result in a waste of resources. Another consequence is that the convergence-layer device tends to track the clock of the access-layer device which is not consistent with the network planning.